import request from '@/utils/request'

export function getSensorListByGatewayId(query) {
    return request({
        url: '/business/sensor/all',
        method: 'get',
        params: query
    })
}

/**
 * 分页查询信息点列表
 */
export function pageListSensor(query) {
    return request({
        url: '/business/sensor/page/list',
        method: 'get',
        params: query
    })
}

// 查询传感器列表
export function listSensor(query) {
    return request({
        url: '/business/sensor/list',
        method: 'get',
        params: query
    })
}

// 查询传感器详细
export function getSensor(sensorId) {
    return request({
        url: '/business/sensor/' + sensorId,
        method: 'get'
    })
}

// 新增传感器
export function addSensor(data) {
    return request({
        url: '/business/sensor',
        method: 'post',
        data: data
    })
}

// 修改传感器
export function updateSensor(data) {
    return request({
        url: '/business/sensor',
        method: 'put',
        data: data
    })
}

// 删除传感器
export function delSensor(sensorId) {
    return request({
        url: '/business/sensor/' + sensorId,
        method: 'delete'
    })
}
